#!/bin/bash
#Filename: print_to_terminal.sh
# -------------------------
# ---non-formatted print---
# -------------------------

# normal use
echo "hello ! world"; # ';' is a delimitor in shell scrips 
# no 'newline' at tail
echo -n 'hello world'
echo hello world
# print with red color
echo -e "\e[1;35m hello world!\e[1;0m"

echo -e "hello\t world"
# when using 'echo' without quotes, we cannot use a semicolon ';'
echo "hello; world"
# echo hello; world 

# ---------------------
# ---formatted print--- 
# ---------------------

# 'printf' only takes quoted text or arguments delimited by space

printf "%-5s %-10s %-4s\n" 1 Sara 80.3456
printf "%-5s %-10s %-4.3s\n" 2 Jason 90.9989 # .3 means show 3chars of the number
printf "%-5s %-10s %-4.2f\n" 3 Jeff 77.567

